package com.qf.feign;

import com.qf.conf.FeignConfig;
import com.qf.pojo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//@RequestMapping("/order") //feign不支持这种提取共性路径写法
/*
    fallback 属性：配置feign层面的降级业务
    fallbackFactory属性： 配置feign层面的降级业务，但是可以捕获到异常信息
 */
//@FeignClient(value = "QF-ORDER",fallback = OrderFallback.class)
@FeignClient(value = "QF-ORDER",fallbackFactory = OrderFallbackFactory.class,configuration = FeignConfig.class)
public interface OrderFeignApi {

    @GetMapping("/order/{id}")
    R findByUid(@PathVariable("id") Integer id);
}
